package com.dykj.fireFighting.web.enums;

public enum FlagDelEnum {
    notDel("0", "notDel", "未删除"),
    isDel("1", "isDel", "已删除"),

    notDisplay("0", "notDisplay", "未禁用"),
    isDisplay("1", "isDisplay", "已禁用");

    private final String code;
    private final String name;
    private final String text;

    public String getText() {
        return text;
    }

    public String getCode() {
        return code;
    }

    public static String getName(String code) {
        for (FlagDelEnum c : FlagDelEnum.values()) {
            if (c.getCode().equals(code)) {
                return c.name;
            }
        }
        return null;
    }

    public static String getTextByCode(String code) {
        for (FlagDelEnum c : FlagDelEnum.values()) {
            if (c.getCode().equals(code)) {
                return c.text;
            }
        }
        return null;
    }

    public static FlagDelEnum getByName(String name) {
        for (FlagDelEnum c : FlagDelEnum.values()) {
            if (c.getName().equals(name)) {
                return c;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    FlagDelEnum(String code, String name, String text) {
        this.code = code;
        this.name = name;
        this.text = text;
    }
}
